package com.botu.springcloudnacosmulticonfig.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author: hanzeyao
 * @Date: 2019/12/9 11:20
 * @Description:
 */
@RestController
@RefreshScope
public class MultiConfigController {

    @Value("${user.name}")
    private String name;
    @Value("${user.age}")
    private String age;
    @Value("${nacos.server}")
    private String server;

    /**
     *
     * @return
     */
    @GetMapping("/multi")
    public String multiConfig(){
        return "name="+name+" age="+age +" server="+server;
    }

}
